/*     */ package com.zimbra.cs.mailbox;
/*     */ 
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.common.service.ServiceException.Argument;
/*     */ import com.zimbra.common.service.ServiceException.Argument.Type;
/*     */ import com.zimbra.cs.service.util.ItemId;
/*     */ import javax.mail.Address;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class MailServiceException
/*     */   extends ServiceException
/*     */ {
/*     */   private static final long serialVersionUID = -2047883574519400960L;
/*     */   public static final String MAINTENANCE = "mail.MAINTENANCE";
/*     */   public static final String NO_SUCH_MBOX = "mail.NO_SUCH_MBOX";
/*     */   public static final String NO_SUCH_ITEM = "mail.NO_SUCH_ITEM";
/*     */   public static final String NO_SUCH_CONV = "mail.NO_SUCH_CONV";
/*     */   public static final String NO_SUCH_MSG = "mail.NO_SUCH_MSG";
/*     */   public static final String NO_SUCH_PART = "mail.NO_SUCH_PART";
/*     */   public static final String NO_SUCH_CONTACT = "mail.NO_SUCH_CONTACT";
/*     */   public static final String NO_SUCH_FOLDER = "mail.NO_SUCH_FOLDER";
/*     */   public static final String NO_SUCH_MOUNTPOINT = "mail.NO_SUCH_MOUNTPOINT";
/*     */   public static final String NO_SUCH_NOTE = "mail.NO_SUCH_NOTE";
/*     */   public static final String NO_SUCH_CALITEM = "mail.NO_SUCH_CALITEM";
/*     */   public static final String NO_SUCH_APPT = "mail.NO_SUCH_APPT";
/*     */   public static final String NO_SUCH_TASK = "mail.NO_SUCH_TASK";
/*     */   public static final String NO_SUCH_DOC = "mail.NO_SUCH_DOC";
/*     */   public static final String NO_SUCH_REVISION = "mail.NO_SUCH_REVISION";
/*     */   public static final String NO_SUCH_TAG = "mail.NO_SUCH_TAG";
/*     */   public static final String NO_SUCH_UPLOAD = "mail.NO_SUCH_UPLOAD";
/*     */   public static final String NO_SUCH_WAITSET = "mail.NO_SUCH_WAITSET";
/*     */   public static final String NO_SUCH_BLOB = "mail.NO_SUCH_BLOB";
/*     */   public static final String NO_SUCH_CHAT = "mail.NO_SUCH_CHAT";
/*     */   public static final String NO_SUCH_GRANTEE = "mail.NO_SUCH_GRANTEE";
/*     */   public static final String ALREADY_EXISTS = "mail.ALREADY_EXISTS";
/*     */   public static final String INVALID_ID = "mail.INVALID_ID";
/*     */   public static final String INVALID_SYNC_TOKEN = "mail.INVALID_SYNC_TOKEN";
/*     */   public static final String INVALID_NAME = "mail.INVALID_NAME";
/*     */   public static final String INVALID_TYPE = "mail.INVALID_TYPE";
/*     */   public static final String INVALID_CONTENT_TYPE = "mail.INVALID_CONTENT_TYPE";
/*     */   public static final String INVALID_METADATA = "mail.INVALID_METADATA";
/*     */   public static final String IS_NOT_CHILD = "mail.IS_NOT_CHILD";
/*     */   public static final String CANNOT_CONTAIN = "mail.CANNOT_CONTAIN";
/*     */   public static final String CANNOT_COPY = "mail.CANNOT_COPY";
/*     */   public static final String CANNOT_TAG = "mail.CANNOT_TAG";
/*     */   public static final String CANNOT_PARENT = "mail.CANNOT_PARENT";
/*     */   public static final String CANNOT_RENAME = "mail.CANNOT_RENAME";
/*     */   public static final String CANNOT_SUBSCRIBE = "mail.CANNOT_SUBSCRIBE";
/*     */   public static final String IMMUTABLE_OBJECT = "mail.IMMUTABLE_OBJECT";
/*     */   public static final String WRONG_MAILBOX = "mail.WRONG_MAILBOX";
/*     */   public static final String MODIFY_CONFLICT = "mail.MODIFY_CONFLICT";
/*     */   public static final String TRY_AGAIN = "mail.TRY_AGAIN";
/*     */   public static final String CANNOT_LOCK = "mail.CANNOT_LOCK";
/*     */   public static final String CANNOT_UNLOCK = "mail.CANNOT_UNLOCK";
/*     */   public static final String LOCKED = "mail.LOCKED";
/*     */   public static final String MUST_RESYNC = "mail.MUST_RESYNC";
/*     */   public static final String SCAN_ERROR = "mail.SCAN_ERROR";
/*     */   public static final String UPLOAD_REJECTED = "mail.UPLOAD_REJECTED";
/*     */   public static final String UPLOAD_TOO_LARGE = "mail.UPLOAD_TOO_LARGE";
/*     */   public static final String TOO_MANY_UPLOADS = "mail.TOO_MANY_UPLOADS";
/*     */   public static final String TOO_MANY_CONTACTS = "mail.TOO_MANY_CONTACTS";
/*     */   public static final String TOO_MUCH_METADATA = "mail.TOO_MUCH_METADATA";
/*     */   public static final String UNABLE_TO_IMPORT_CONTACTS = "mail.UNABLE_TO_IMPORT_CONTACTS";
/*     */   public static final String UNABLE_TO_EXPORT_CONTACTS = "mail.UNABLE_TO_EXPORT_CONTACTS";
/*     */   public static final String UNABLE_TO_IMPORT_APPOINTMENTS = "mail.UNABLE_TO_IMPORT_APPOINTMENTS";
/*     */   public static final String QUOTA_EXCEEDED = "mail.QUOTA_EXCEEDED";
/*     */   public static final String DOMAIN_QUOTA_EXCEEDED = "mail.DOMAIN_QUOTA_EXCEEDED";
/*     */   public static final String QUERY_PARSE_ERROR = "mail.QUERY_PARSE_ERROR";
/*     */   public static final String MESSAGE_PARSE_ERROR = "mail.MESSAGE_PARSE_ERROR";
/*     */   public static final String ADDRESS_PARSE_ERROR = "mail.ADDRESS_PARSE_ERROR";
/*     */   public static final String ICALENDAR_PARSE_ERROR = "mail.ICALENDAR_PARSE_ERROR";
/*     */   public static final String MUST_BE_ORGANIZER = "mail.MUST_BE_ORGANIZER";
/*     */   public static final String CANNOT_CANCEL_INSTANCE_OF_EXCEPTION = "mail.CANNOT_CANCEL_INSTANCE_OF_EXCEPTION";
/*     */   public static final String INVITE_OUT_OF_DATE = "mail.INVITE_OUT_OF_DATE";
/*     */   public static final String SEND_ABORTED_ADDRESS_FAILURE = "mail.SEND_ABORTED_ADDRESS_FAILURE";
/*     */   public static final String SEND_PARTIAL_ADDRESS_FAILURE = "mail.SEND_PARTIAL_ADDRESS_FAILURE";
/*     */   public static final String SEND_FAILURE = "mail.SEND_FAILURE";
/*     */   public static final String TOO_MANY_QUERY_TERMS_EXPANDED = "mail.TOO_MANY_QUERY_TERMS_EXPANDED";
/*     */   public static final String MESSAGE_TOO_BIG = "mail.MESSAGE_TOO_BIG";
/*     */   public static final String CONTACT_TOO_BIG = "mail.CONTACT_TOO_BIG";
/*     */   public static final String CANNOT_GRANT = "mail.CANNOT_GRANT";
/*     */   public static final String INVALID_COMMIT_ID = "mail.INVALID_COMMIT_ID";
/*     */   public static final String INVALID_IMAGE = "mail.INVALID_IMAGE";
/*     */   public static final String TEMPORARY_ANALYSIS_ERROR = "mail.TEMPORARY_ANALYSIS_ERROR";
/*     */   public static final String GRANT_EXISTS = "mail.GRANT_EXISTS";
/*     */   public static final String ID = "id";
/*     */   public static final String TOKEN = "token";
/*     */   public static final String ITEM_ID = "itemId";
/*     */   public static final String REMOTE_ACCOUNT_ID = "remoteAcctId";
/*     */   public static final String REMOTE_ITEM_ID = "remoteItemId";
/*     */   public static final String REVISION = "ver";
/*     */   public static final String NAME = "name";
/*     */   public static final String PATH = "path";
/*     */   public static final String UID = "uid";
/*     */   public static final String UPLOAD_ID = "uploadId";
/*     */   public static final String LIMIT = "limit";
/*     */   public static final String TYPE = "type";
/*     */   public static final String CURRENT_TOKEN = "curTok";
/*     */   public static final String LINE_NO = "lineNo";
/*     */   public static final String COL_NO = "colNo";
/*     */   public static final String PARSER_ERR = "parserErr";
/*     */   
/*     */   public static class NoSuchItemException
/*     */     extends MailServiceException
/*     */   {
/*     */     private static final long serialVersionUID = -3367247762350948868L;
/*     */     
/*     */     NoSuchItemException(String message, String code, boolean isReceiversFault, Throwable cause, ServiceException.Argument... args)
/*     */     {
/* 137 */       super(code, isReceiversFault, cause, args);
/*     */     }
/*     */     
/* 140 */     NoSuchItemException(String message, String code, boolean isReceiversFault, ServiceException.Argument... args) { super(code, isReceiversFault, null, args); }
/*     */   }
/*     */   
/*     */   private MailServiceException(String message, String code, boolean isReceiversFault, ServiceException.Argument... args)
/*     */   {
/* 145 */     super(message, code, isReceiversFault, args);
/*     */   }
/*     */   
/*     */   MailServiceException(String message, String code, boolean isReceiversFault, Throwable cause, ServiceException.Argument... args) {
/* 149 */     super(message, code, isReceiversFault, cause, args);
/*     */   }
/*     */   
/*     */   public static MailServiceException MAINTENANCE(int id) {
/* 153 */     return MAINTENANCE(id, null);
/*     */   }
/*     */   
/*     */   public static MailServiceException MAINTENANCE(int id, String message) {
/* 157 */     return new MailServiceException("mailbox in maintenance mode: " + id + (message != null ? " reason: " + message : ""), "mail.MAINTENANCE", true, new ServiceException.Argument[] { new ServiceException.Argument("mboxId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_MBOX(int id) {
/* 161 */     return new MailServiceException("no such mailbox: " + id, "mail.NO_SUCH_MBOX", false, new ServiceException.Argument[] { new ServiceException.Argument("mboxId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_MBOX(String accountId) {
/* 165 */     return new MailServiceException("no mailbox for account: " + accountId, "mail.NO_SUCH_MBOX", false, new ServiceException.Argument[] { new ServiceException.Argument("acctId", accountId, ServiceException.Argument.Type.ACCTID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_ITEM(int id) {
/* 169 */     return new NoSuchItemException("no such item: " + id, "mail.NO_SUCH_ITEM", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_ITEM_UUID(String uuid) {
/* 173 */     return new NoSuchItemException("no such item uuid: " + uuid, "mail.NO_SUCH_ITEM", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", uuid, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_ITEM(String name) {
/* 177 */     return new NoSuchItemException("no such item: " + name, "mail.NO_SUCH_ITEM", false, new ServiceException.Argument[] { new ServiceException.Argument("name", name, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_CONV(int id) {
/* 181 */     return new NoSuchItemException("no such conversation: " + id, "mail.NO_SUCH_CONV", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_MSG(int id) {
/* 185 */     return new NoSuchItemException("no such message: " + id, "mail.NO_SUCH_MSG", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_PART(String name) {
/* 189 */     return new MailServiceException("no such message part: " + name, "mail.NO_SUCH_PART", false, new ServiceException.Argument[] { new ServiceException.Argument("name", name, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_CONTACT(int id) {
/* 193 */     return new NoSuchItemException("no such contact: " + id, "mail.NO_SUCH_CONTACT", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_FOLDER(int id) {
/* 197 */     return new NoSuchItemException("no such folder id: " + id, "mail.NO_SUCH_FOLDER", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_FOLDER_UUID(String uuid) {
/* 201 */     return new NoSuchItemException("no such folder uuid: " + uuid, "mail.NO_SUCH_FOLDER", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", uuid, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_FOLDER(String path) {
/* 205 */     return new NoSuchItemException("no such folder path: " + path, "mail.NO_SUCH_FOLDER", false, new ServiceException.Argument[] { new ServiceException.Argument("path", path, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_MOUNTPOINT(int id, String remoteAccountId, int remoteId, Throwable t) {
/* 209 */     return new NoSuchItemException("no such mountpoint id: " + id + "; owner = " + remoteAccountId + ", remoteId=" + remoteId, "mail.NO_SUCH_MOUNTPOINT", false, t, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID), new ServiceException.Argument("remoteAcctId", remoteAccountId, ServiceException.Argument.Type.ACCTID), new ServiceException.Argument("remoteItemId", remoteId, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static MailServiceException NO_SUCH_MOUNTPOINT_UUID(String uuid, String remoteAccountId, int remoteId, Throwable t)
/*     */   {
/* 217 */     return new NoSuchItemException("no such mountpoint uuid: " + uuid + "; owner = " + remoteAccountId + ", remoteId=" + remoteId, "mail.NO_SUCH_MOUNTPOINT", false, t, new ServiceException.Argument[] { new ServiceException.Argument("itemId", uuid, ServiceException.Argument.Type.IID), new ServiceException.Argument("remoteAcctId", remoteAccountId, ServiceException.Argument.Type.ACCTID), new ServiceException.Argument("remoteItemId", remoteId, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static MailServiceException NO_SUCH_NOTE(int id)
/*     */   {
/* 225 */     return new NoSuchItemException("no such note: " + id, "mail.NO_SUCH_NOTE", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_CALITEM(int id) {
/* 229 */     return new NoSuchItemException("no such appointment or task: " + id, "mail.NO_SUCH_CALITEM", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_CALITEM(int id, String msg) {
/* 233 */     return new NoSuchItemException("no such appointment or task: " + id + "; " + msg, "mail.NO_SUCH_CALITEM", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_CALITEM(String uid) {
/* 237 */     return new NoSuchItemException("no such appointment or task: " + uid, "mail.NO_SUCH_CALITEM", false, new ServiceException.Argument[] { new ServiceException.Argument("uid", uid, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_CALITEM(String uid, String msg) {
/* 241 */     return new MailServiceException("no such appointment or task: " + uid + "; " + msg, "mail.NO_SUCH_CALITEM", false, new ServiceException.Argument[] { new ServiceException.Argument("uid", uid, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_APPT(int id) {
/* 245 */     return new NoSuchItemException("no such appointment: " + id, "mail.NO_SUCH_APPT", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_APPT(String uid) {
/* 249 */     return new NoSuchItemException("no such appointment: " + uid, "mail.NO_SUCH_APPT", false, new ServiceException.Argument[] { new ServiceException.Argument("uid", uid, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_APPT(String uid, String msg) {
/* 253 */     return new MailServiceException("no such appointment: " + uid + " " + msg, "mail.NO_SUCH_APPT", false, new ServiceException.Argument[] { new ServiceException.Argument("uid", uid, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_TASK(int id) {
/* 257 */     return new NoSuchItemException("no such task: " + id, "mail.NO_SUCH_TASK", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_TASK(String uid) {
/* 261 */     return new NoSuchItemException("no such task: " + uid, "mail.NO_SUCH_TASK", false, new ServiceException.Argument[] { new ServiceException.Argument("uid", uid, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_TASK(String uid, String msg) {
/* 265 */     return new MailServiceException("no such task: " + uid + " " + msg, "mail.NO_SUCH_TASK", false, new ServiceException.Argument[] { new ServiceException.Argument("uid", uid, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_DOC(String path) {
/* 269 */     return new NoSuchItemException("no such document: " + path, "mail.NO_SUCH_ITEM", false, new ServiceException.Argument[] { new ServiceException.Argument("name", path, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_DOC(int id) {
/* 273 */     return new NoSuchItemException("no such document: " + id, "mail.NO_SUCH_DOC", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_DOC_UUID(String uuid) {
/* 277 */     return new NoSuchItemException("no such document: " + uuid, "mail.NO_SUCH_DOC", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", uuid, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_REVISION(int docId, int version) {
/* 281 */     return new NoSuchItemException("no such revision: " + docId + '/' + version, "mail.NO_SUCH_REVISION", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", docId, ServiceException.Argument.Type.IID), new ServiceException.Argument("ver", version, ServiceException.Argument.Type.NUM) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_REVISION_UUID(String docUuid, int version) {
/* 285 */     return new NoSuchItemException("no such revision: " + docUuid + '/' + version, "mail.NO_SUCH_REVISION", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", docUuid, ServiceException.Argument.Type.IID), new ServiceException.Argument("ver", version, ServiceException.Argument.Type.NUM) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_TAG(int id) {
/* 289 */     return new NoSuchItemException("no such tag: " + id, "mail.NO_SUCH_TAG", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_TAG(String name) {
/* 293 */     return new NoSuchItemException("no such tag: " + name, "mail.NO_SUCH_TAG", false, new ServiceException.Argument[] { new ServiceException.Argument("name", name, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_UPLOAD(String uploadId) {
/* 297 */     return new MailServiceException("upload not found: " + uploadId, "mail.NO_SUCH_UPLOAD", false, new ServiceException.Argument[] { new ServiceException.Argument("uploadId", uploadId, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_WAITSET(String id) {
/* 301 */     return new MailServiceException("WaitSet not found: " + id, "mail.NO_SUCH_WAITSET", false, new ServiceException.Argument[] { new ServiceException.Argument("id", id, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_BLOB(int mboxId, int itemId, int revision) {
/* 305 */     return new MailServiceException("No such blob: mailbox=" + mboxId + ", item=" + itemId + ", change=" + revision, "mail.NO_SUCH_BLOB", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", itemId, ServiceException.Argument.Type.IID), new ServiceException.Argument("ver", revision, ServiceException.Argument.Type.NUM) });
/*     */   }
/*     */   
/*     */   public static MailServiceException NO_SUCH_CHAT(String threadId)
/*     */   {
/* 310 */     return new MailServiceException("No such chat: threadId=" + threadId, "mail.NO_SUCH_CHAT", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException SCAN_ERROR(String file) {
/* 314 */     return new MailServiceException("upload could not be scanned: file '" + file + "'", "mail.SCAN_ERROR", true, new ServiceException.Argument[] { new ServiceException.Argument("name", file, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException UPLOAD_REJECTED(String file, String reason) {
/* 318 */     return new MailServiceException("upload rejected: file '" + file + "': " + reason, "mail.UPLOAD_REJECTED", false, new ServiceException.Argument[] { new ServiceException.Argument("name", file, ServiceException.Argument.Type.STR), new ServiceException.Argument("reason", reason, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException UPLOAD_TOO_LARGE(String file, String reason) {
/* 322 */     return new MailServiceException("upload too large: file '" + file + "': " + reason, "mail.UPLOAD_TOO_LARGE", false, new ServiceException.Argument[] { new ServiceException.Argument("name", file, ServiceException.Argument.Type.STR), new ServiceException.Argument("reason", reason, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException TOO_MANY_HOPS(ItemId iid)
/*     */   {
/* 327 */     return new MailServiceException("proxy loop detected", "service.TOO_MANY_HOPS", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", iid.toString(), ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException TOO_MANY_UPLOADS(String uploadId) {
/* 331 */     return new MailServiceException("more than 1 file uploaded: " + uploadId, "mail.TOO_MANY_UPLOADS", false, new ServiceException.Argument[] { new ServiceException.Argument("uploadId", uploadId, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException TOO_MANY_CONTACTS(int limit) {
/* 335 */     return new MailServiceException("exceeded limit of " + limit + " contacts", "mail.TOO_MANY_CONTACTS", false, new ServiceException.Argument[] { new ServiceException.Argument("limit", limit, ServiceException.Argument.Type.NUM) });
/*     */   }
/*     */   
/*     */   public static MailServiceException TOO_MUCH_METADATA(int limit) {
/* 339 */     return new MailServiceException("exceeded limit of " + limit + " chars of custom metadata", "mail.TOO_MUCH_METADATA", false, new ServiceException.Argument[] { new ServiceException.Argument("limit", limit, ServiceException.Argument.Type.NUM) });
/*     */   }
/*     */   
/*     */   public static MailServiceException UNABLE_TO_IMPORT_CONTACTS(String msg, Throwable t) {
/* 343 */     return new MailServiceException(msg, "mail.UNABLE_TO_IMPORT_CONTACTS", false, t, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException UNABLE_TO_EXPORT_CONTACTS(String msg, Throwable t) {
/* 347 */     return new MailServiceException(msg, "mail.UNABLE_TO_IMPORT_CONTACTS", false, t, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException UNABLE_TO_IMPORT_APPOINTMENTS(String msg, Throwable t) {
/* 351 */     return new MailServiceException(msg, "mail.UNABLE_TO_IMPORT_APPOINTMENTS", false, t, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException QUOTA_EXCEEDED(long limit) {
/* 355 */     return new MailServiceException("mailbox exceeded quota of " + limit + " bytes", "mail.QUOTA_EXCEEDED", false, new ServiceException.Argument[] { new ServiceException.Argument("limit", limit, ServiceException.Argument.Type.NUM) });
/*     */   }
/*     */   
/*     */   public static MailServiceException DOMAIN_QUOTA_EXCEEDED(long limit) {
/* 359 */     return new MailServiceException("domain exceeded aggregate quota of " + limit + " bytes", "mail.DOMAIN_QUOTA_EXCEEDED", false, new ServiceException.Argument[] { new ServiceException.Argument("limit", limit, ServiceException.Argument.Type.NUM) });
/*     */   }
/*     */   
/*     */   public static MailServiceException INVALID_ID(int id) {
/* 363 */     return new MailServiceException("item id out of range: " + id, "mail.INVALID_ID", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException INVALID_SYNC_TOKEN(String s) {
/* 367 */     return new MailServiceException("Invalid Sync Token: " + s, "mail.INVALID_SYNC_TOKEN", false, new ServiceException.Argument[] { new ServiceException.Argument("token", s, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException INVALID_NAME(String name) {
/* 371 */     return new MailServiceException("invalid name: " + name, "mail.INVALID_NAME", false, new ServiceException.Argument[] { new ServiceException.Argument("name", name, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException INVALID_TYPE(String type) {
/* 375 */     return new MailServiceException("invalid item type: " + type, "mail.INVALID_TYPE", false, new ServiceException.Argument[] { new ServiceException.Argument("type", type, ServiceException.Argument.Type.NUM) });
/*     */   }
/*     */   
/*     */   public static MailServiceException INVALID_CONTENT_TYPE(String type) {
/* 379 */     return new MailServiceException("invalid content type: " + type, "mail.INVALID_CONTENT_TYPE", false, new ServiceException.Argument[] { new ServiceException.Argument("type", type, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException INVALID_METADATA(String metadata, Throwable t) {
/* 383 */     return new MailServiceException("invalid metadata: " + metadata, "mail.INVALID_METADATA", true, t, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException WRONG_MAILBOX() {
/* 387 */     return new MailServiceException("cannot combine objects from different mailboxes", "mail.WRONG_MAILBOX", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_TAG(Tag tag, MailItem item) {
/* 391 */     return new MailServiceException("cannot apply tag \"" + tag.getName() + "\" to item " + item.getId(), "mail.CANNOT_TAG", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_SUBSCRIBE(int id) {
/* 395 */     return new MailServiceException("cannot add subscription to existing folder " + id, "mail.CANNOT_SUBSCRIBE", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_CONTAIN() {
/* 399 */     return new MailServiceException("cannot put object in that folder", "mail.CANNOT_CONTAIN", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_CONTAIN(Folder parent, MailItem.Type type) {
/* 403 */     String parentName = "folder " + parent.getPath();
/* 404 */     return new MailServiceException(parentName + " cannot contain an item of type " + type, "mail.CANNOT_CONTAIN", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_COPY(int id) {
/* 408 */     return new MailServiceException("cannot copy object: " + id, "mail.CANNOT_COPY", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_PARENT() {
/* 412 */     return new MailServiceException("cannot make object a child of that parent", "mail.CANNOT_PARENT", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_RENAME(MailItem.Type type) {
/* 416 */     return new MailServiceException("cannot set the name on a " + type, "mail.CANNOT_RENAME", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_GRANT(String msg) {
/* 420 */     return new MailServiceException("cannot grant: " + msg, "mail.CANNOT_GRANT", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException IS_NOT_CHILD() {
/* 424 */     return new MailServiceException("tried to remove object from non-parent", "mail.IS_NOT_CHILD", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException MODIFY_CONFLICT(ServiceException.Argument... args) {
/* 428 */     return new MailServiceException("modify conflict", "mail.MODIFY_CONFLICT", false, args);
/*     */   }
/*     */   
/*     */   public static MailServiceException IMMUTABLE_OBJECT(int id) {
/* 432 */     return new MailServiceException("cannot modify immutable object: " + id, "mail.IMMUTABLE_OBJECT", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException ALREADY_EXISTS(String name) {
/* 436 */     return new MailServiceException("object with that name already exists: " + name, "mail.ALREADY_EXISTS", false, new ServiceException.Argument[] { new ServiceException.Argument("name", name, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException ALREADY_EXISTS(String msg, String name, int id)
/*     */   {
/* 441 */     return new MailServiceException("document already exists: " + msg, "mail.ALREADY_EXISTS", false, new ServiceException.Argument[] { new ServiceException.Argument("name", name, ServiceException.Argument.Type.STR), new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException ALREADY_EXISTS(String msg, String name, int id, int revision)
/*     */   {
/* 446 */     return new MailServiceException("document already exists: " + msg, "mail.ALREADY_EXISTS", false, new ServiceException.Argument[] { new ServiceException.Argument("name", name, ServiceException.Argument.Type.STR), new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID), new ServiceException.Argument("ver", revision, ServiceException.Argument.Type.NUM) });
/*     */   }
/*     */   
/*     */   public static MailServiceException ALREADY_EXISTS(String name, Throwable t)
/*     */   {
/* 451 */     return new MailServiceException("object with that name already exists: " + name, "mail.ALREADY_EXISTS", false, t, new ServiceException.Argument[] { new ServiceException.Argument("name", name, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */   public static MailServiceException ALREADY_EXISTS(int id, Throwable t) {
/* 455 */     return new MailServiceException("object with that id already exists: " + id, "mail.ALREADY_EXISTS", false, t, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException QUERY_PARSE_ERROR(String query, Throwable t, String curToken, int offset, String parserErr) {
/* 459 */     return new MailServiceException("Couldn't parse query: " + query, "mail.QUERY_PARSE_ERROR", false, t, new ServiceException.Argument[] { new ServiceException.Argument("curTok", curToken, ServiceException.Argument.Type.STR), new ServiceException.Argument("colNo", offset, ServiceException.Argument.Type.NUM), new ServiceException.Argument("parserErr", parserErr, ServiceException.Argument.Type.STR) });
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static MailServiceException MESSAGE_PARSE_ERROR(Throwable t)
/*     */   {
/* 468 */     return new MailServiceException("Couldn't parse message", "mail.MESSAGE_PARSE_ERROR", false, t, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException ADDRESS_PARSE_ERROR(Throwable t) {
/* 472 */     return new MailServiceException("Couldn't parse address", "mail.ADDRESS_PARSE_ERROR", false, t, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException ADDRESS_PARSE_ERROR(String msg, Throwable t) {
/* 476 */     return new MailServiceException("Couldn't parse address: " + msg, "mail.ADDRESS_PARSE_ERROR", false, t, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException ICALENDAR_PARSE_ERROR(String s, Throwable t) {
/* 480 */     return new MailServiceException("Couldn't parse iCalendar information: " + s, "mail.ICALENDAR_PARSE_ERROR", false, t, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException MUST_BE_ORGANIZER(String request) {
/* 484 */     return new MailServiceException("You are not Organizer in call to: " + request, "mail.MUST_BE_ORGANIZER", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_CANCEL_INSTANCE_OF_EXCEPTION(String request) {
/* 488 */     return new MailServiceException("You cannot cancel a specific instance of an Exception, specify the default invite instead: " + request, "mail.CANNOT_CANCEL_INSTANCE_OF_EXCEPTION", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public static MailServiceException INVITE_OUT_OF_DATE(String request)
/*     */   {
/* 495 */     return new MailServiceException("The specified Invite is out of date (has been updated): " + request, "mail.INVITE_OUT_OF_DATE", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   private static MailServiceException internal_SEND_FAILURE(String failureType, String msg, Exception e, Address[] invalid, Address[] unsent)
/*     */   {
/* 502 */     int len = 0;
/* 503 */     if (invalid != null)
/* 504 */       len += invalid.length;
/* 505 */     if (unsent != null)
/* 506 */       len += unsent.length;
/* 507 */     ServiceException.Argument[] args = new ServiceException.Argument[len];
/*     */     
/* 509 */     int offset = 0;
/* 510 */     if (invalid != null) {
/* 511 */       for (Address addr : invalid)
/* 512 */         args[(offset++)] = new ServiceException.Argument("invalid", addr.toString(), ServiceException.Argument.Type.STR);
/*     */     }
/* 514 */     if (unsent != null) {
/* 515 */       for (Address addr : unsent) {
/* 516 */         args[(offset++)] = new ServiceException.Argument("unsent", addr.toString(), ServiceException.Argument.Type.STR);
/*     */       }
/*     */     }
/* 519 */     return new MailServiceException(msg, failureType, false, e, args);
/*     */   }
/*     */   
/*     */   public static MailServiceException SEND_ABORTED_ADDRESS_FAILURE(String msg, Exception e, Address[] invalid, Address[] unsent) {
/* 523 */     return internal_SEND_FAILURE("mail.SEND_ABORTED_ADDRESS_FAILURE", msg, e, invalid, unsent);
/*     */   }
/*     */   
/*     */   public static MailServiceException SEND_PARTIAL_ADDRESS_FAILURE(String msg, Exception e, Address[] invalid, Address[] unsent) {
/* 527 */     return internal_SEND_FAILURE("mail.SEND_PARTIAL_ADDRESS_FAILURE", msg, e, invalid, unsent);
/*     */   }
/*     */   
/*     */   public static MailServiceException SEND_FAILURE(String msg, Exception e, Address[] invalid, Address[] unsent) {
/* 531 */     return internal_SEND_FAILURE("mail.SEND_FAILURE", msg, e, invalid, unsent);
/*     */   }
/*     */   
/*     */   public static MailServiceException TRY_AGAIN(String msg) {
/* 535 */     return new MailServiceException("try again: " + msg, "mail.TRY_AGAIN", true, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException TRY_AGAIN(String msg, Exception e) {
/* 539 */     return new MailServiceException("try again: " + msg, "mail.TRY_AGAIN", true, e, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException TOO_MANY_QUERY_TERMS_EXPANDED(String msg, String token, int max) {
/* 543 */     return new MailServiceException(msg, "mail.TOO_MANY_QUERY_TERMS_EXPANDED", false, new ServiceException.Argument[] { new ServiceException.Argument("TOKEN", token, ServiceException.Argument.Type.STR), new ServiceException.Argument("MAX", max, ServiceException.Argument.Type.NUM) });
/*     */   }
/*     */   
/*     */   public static MailServiceException INVALID_COMMIT_ID(String commitId) {
/* 547 */     return new MailServiceException("CommitId " + commitId + " not found in redo logs", "mail.INVALID_COMMIT_ID", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException MESSAGE_TOO_BIG(long maxSize, long actualSize) {
/* 551 */     ServiceException.Argument arg = new ServiceException.Argument("maxSize", maxSize, ServiceException.Argument.Type.NUM);
/* 552 */     return new MailServiceException("Message of size " + actualSize + " exceeded allowed size", "mail.MESSAGE_TOO_BIG", false, new ServiceException.Argument[] { arg });
/*     */   }
/*     */   
/*     */   public static MailServiceException CONTACT_TOO_BIG(long max, long actual) {
/* 556 */     ServiceException.Argument arg = new ServiceException.Argument("maxSize", max, ServiceException.Argument.Type.NUM);
/* 557 */     return new MailServiceException("Contact of size " + actual + " exceeded allowed size", "mail.CONTACT_TOO_BIG", false, new ServiceException.Argument[] { arg });
/*     */   }
/*     */   
/*     */   public static MailServiceException TEMPORARY_ANALYSIS_ERROR() {
/* 561 */     return new MailServiceException("Temporary Analysis Error", "mail.TEMPORARY_ANALYSIS_ERROR", true, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_LOCK(int id) {
/* 565 */     return new MailServiceException("cannot lock item: " + id, "mail.CANNOT_LOCK", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_LOCK(int id, String accountId) {
/* 569 */     return new MailServiceException("cannot lock item: " + id, "mail.CANNOT_LOCK", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID), new ServiceException.Argument("acctId", accountId, ServiceException.Argument.Type.ACCTID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_UNLOCK(int id) {
/* 573 */     return new MailServiceException("cannot unlock item: " + id, "mail.CANNOT_UNLOCK", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException CANNOT_UNLOCK(int id, String accountId) {
/* 577 */     return new MailServiceException("cannot unlock item: " + id, "mail.CANNOT_UNLOCK", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID), new ServiceException.Argument("acctId", accountId, ServiceException.Argument.Type.ACCTID) });
/*     */   }
/*     */   
/*     */   public static MailServiceException LOCKED(int id, String accountId) {
/* 581 */     return new MailServiceException("item is locked: " + id, "mail.LOCKED", false, new ServiceException.Argument[] { new ServiceException.Argument("itemId", id, ServiceException.Argument.Type.IID), new ServiceException.Argument("acctId", accountId, ServiceException.Argument.Type.ACCTID) });
/*     */   }
/*     */   
/*     */   public static ServiceException TOMBSTONES_EXPIRED() {
/* 585 */     return new MailServiceException("sync token too old; tombstones have already been expired", "mail.MUST_RESYNC", false, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static ServiceException NO_SUCH_GRANTEE(String message, Throwable cause) {
/* 589 */     return new MailServiceException("no such grantee " + message, "mail.NO_SUCH_GRANTEE", false, cause, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static ServiceException GRANTEE_EXISTS(String message, Throwable cause) {
/* 593 */     return new MailServiceException("grantee already exists " + message, "mail.GRANT_EXISTS", false, cause, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static ServiceException INVALID_IMAGE(String message) {
/* 597 */     return new MailServiceException(message, "mail.INVALID_IMAGE", false, new ServiceException.Argument[0]);
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/mailbox/MailServiceException.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */